var http = require('http'),dc_config=require('./config')['poc'];
	var options = {
		hostname: dc_config.workflow, 
		path: '/jobs?execution=queued',
		method: 'GET',
		headers: {"Accept": "application/json"}
	};
	var req = http.request(options, function (res) {
		var body = '';
		res.setEncoding('utf8');
		res.on('data',function(d){
			body += d;
		}).on('end', function(){
			var jobs=JSON.parse(body)
			for(var i in jobs){
				cancel(jobs[i].uuid)
			}
		})
	}).on('error', function(e) {
		console.log(e.message);
	})
	req.end();
function cancel(jobUuid){
	var options = {
		hostname: dc_config.workflow, 
		path: '/jobs/'+jobUuid+'/cancel',
		method: 'POST',
		headers: {"Accept": "application/json"}
	};
	var req = http.request(options, function (res) {
		res.on('data',function(d){})
		.on('end', function(){})
	}).on('error', function(e) {console.log(e.message);})
	req.end();
}